package basics;

/**
 * @author dataexa
 * @Date 2023/9/4
 * 循环操作
 */
public class LoopTest {
    public static void main(String[] args) {
//         while循环: 先判断循环条件，再循环
        int count = 0;
        while (count < 2) {
            System.out.println(count + " ");
            count++;
        }
//        do-while循环:先执行循环，再判断条件, 至少循环一次
        int count2 = 0;
        do {
            System.out.println(count2 + " ");
            count2++;
        } while (count2 < -1);
//         for循环
        for (int i = 0; i < 1; i++) {
            System.out.print(i + " ");
        }
    }

}
